package vip.liux.contracts.shared.enums;

import com.google.common.base.Objects;
import vip.liux.core.enums.IEnum;

/**
 * 状态枚举
 * <p>
 * 0 - 启用
 * 1 - 禁用
 */
public enum Status implements IEnum {
    ENABLED(0, "启用"),
    DISABLED(1, "禁用");

    final int value;

    final String desc;

    Status(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }


    public static boolean isEnable(Integer status) {
        return Objects.equal(ENABLED.value, status);
    }

    public static boolean isDisable(Integer status) {
        return Objects.equal(DISABLED.value, status);
    }

}